using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Management.Core.Models.Mapping;

namespace Management.Core.Models
{
    public partial class YLContext : DbContext
    {
        static YLContext()
        {
            Database.SetInitializer<YLContext>(null);
        }

        public YLContext()
            : base("Name=YLContext")
        {
        }

        public DbSet<AdminRole> AdminRoles { get; set; }
        public DbSet<Admin> Admins { get; set; }
        public DbSet<News> News { get; set; }
        public DbSet<Role> Roles { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AdminRoleMap());
            modelBuilder.Configurations.Add(new AdminMap());
            modelBuilder.Configurations.Add(new NewsMap());
            modelBuilder.Configurations.Add(new RoleMap());
        }
    }
}
